@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @component('backend::component.tpl_frame')
        @slot('page_title') <span class="text-danger">当前状态:{{config('shop.order_status')[$info->status]}}</span> @endslot
        @slot('icon') hcl-status-sm @endslot
        @slot('tools_btn')

            @component('backend::component.form.button')
                @slot('title') 修改收货信息 @endslot
                @slot('elem') a @endslot
                @slot('btn') btn @endslot
                @slot('color') primary @endslot
                @slot('icon') hcl-edit @endslot
                @slot('class') modal-box @endslot
                @slot('params') {"area":"600px,500px","title":"修改收货信息"} @endslot
                @slot('href') {{route('b_ShopOrder_editPostInfo',['order_id'=>$info->order_id])}} @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 打印订单 @endslot
                @slot('elem') a @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-edit @endslot
                @slot('href') {{route('b_ShopOrder_printOrder',['order_id'=>$info->order_id])}} @endslot
            @endcomponent
            @if($info->status == 1)
                @component('backend::component.form.button')
                    @slot('title') 确认发货 @endslot
                    @slot('elem') a @endslot
                    @slot('color') info @endslot
                    @slot('icon') hcl-edit @endslot
                    @slot('class') modal-box @endslot
                    @slot('params') {"area":"600px,400px","title":"确认发货"} @endslot
                    @slot('href') {{route('b_ShopOrder_deliverGoods',['order_id'=>$info->order_id])}} @endslot
                @endcomponent
            @endif
            @if($info->status == 0)
                @component('backend::component.form.button')
                    @slot('title') 修改费用 @endslot
                    @slot('elem') a @endslot
                    @slot('color') info @endslot
                    @slot('icon') hcl-edit @endslot
                    @slot('class') modal-box @endslot
                    @slot('params') {"area":"600px,500px","title":"修改费用"} @endslot
                    @slot('href') {{route('b_ShopOrder_editPayMoney',['order_id'=>$info->order_id])}} @endslot
                @endcomponent
            @endif
            @if($info->status > -1)
                @component('backend::component.form.button')
                    @slot('title') 关闭订单 @endslot
                    @slot('icon') hcl-circle-del @endslot
                    @slot('color') danger @endslot
                    @slot('params') {"url":"{{route('b_ShopOrder_close',['order_id'=>$info->order_id])}}","confirm":"true"} @endslot
                    @slot('class') btn-ajax @endslot
                @endcomponent
            @endif
        @endslot
        @slot('body_content')
            @if($info)
                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>基本信息</h4>
                <table class="table table-bordered table-striped tbody info-card">
                    <tbody>
                    <tr><td>订单编号</td><td>用户账号</td><td>支付方式</td><td>订单状态</td></tr>
                    <tr><td>{{$info->order_sn}}</td><td>{{$info->user->user_number}}</td>
                        <td>{{config('shop.pay_type')[$info->pay_type]}}</td> <td>{{config('shop.order_status')[$info->status]}}</td>
                    </tr>
                    <tr><td>下单时间</td><td>订单所属区</td><td>配送方式</td><td>物流单号</td></tr>
                    <tr><td>{{$info->created_at}}</td> <td>{{config('shop.zone')[$info->goods_zone]}}</td>
                        @if($info->status >=2)
                        <td>{{get_expresses()[$info->express_name]}}</td><td>{{$info->express_num}}</td>
                        @else
                            <td>未发货</td><td>未发货</td>
                        @endif
                    </tr>
                    </tbody>
                </table>
                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>收货人信息</h4>
                <table class="table table-bordered table-striped tbody info-card">
                    <tbody>
                    <tr><td>收货人</td><td>联系方式</td><td>收货地址</td><td>邮编</td></tr>
                    <tr><td>{{$info->consignee}}</td><td>{{$info->phone}}</td>
                        <td>{{$info->post_address}}</td> <td>{{$info->zip_code ?? '无'}}</td>
                    </tr>
                    </tbody>
                </table>

                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>商品信息</h4>
                <table class="table table-bordered tbody info-card">
                    <tbody>
                    <tr class="table-secondary"><td>商品图片</td><td>商品名称</td><td>价格</td><td>属性</td><td>数量</td><td>小计</td></tr>
                    @foreach($info->goods as $item)
                    <tr><td><img style="height: 50px;" src="{{$item->goods_img}}"></td>
                        <td>{{$item->goods_name}}</td>
                        <td>{{$item->price}}</td>
                        <td>{{$item->goods_spec}}</td>
                        <td>{{$item->number}}</td> <td>{{$item->pay_money}}</td>
                    </tr>
                    @endforeach
                    <tr class="table-secondary"><td colspan="6">
                            <span class="float-right font-weight-bold mr-5" style="font-size: 16px;">合计:<code style="font-size: 18px;">{{$info->goods_price}}</code></span>
                        </td></tr>
                    </tbody>
                </table>

                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>费用信息</h4>
                <table class="table table-bordered table-striped tbody info-card">
                    <tbody>
                    <tr><td>商品合计</td><td>运费</td><td>抵扣金额</td><td>订单总金额</td><td>应付金额</td><td>实付付金额</td></tr>
                    <tr><td>{{$info->goods_price}}</td><td>{{$info->post_cost}}</td><td>{{$info->pay_xf_points}}</td>
                        <td>{{$info->goods_price+$info->post_cost}}</td> <td>{{$info->total_price}}</td>
                        <td>{{$info->pay_price}}</td>
                    </tr>
                    </tbody>
                </table>
                @if($info->pay_type == 1)
                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>支付信息</h4>
                <table class="table table-bordered table-striped tbody info-card">
                    <tbody>
                    <tr><td>支付备注</td><td>打款凭证</td></tr>
                    <tr><td>{{$info->remark}}</td>
                        <td>
                            <img onclick="showImg(this)" height="180" class="mr-5" src="{{$info->voucher}}">
                        </td>
                    </tr>
                    </tbody>
                </table>
                @endif
                <h4 class="mb-2 text-dark" style="font-size: 1.01rem;"><i class="hcl hcl-sq mr-1" style="font-size: 1.05rem;"></i>操作信息</h4>
                <table class="table table-bordered table-striped tbody info-card">
                    <tbody>
                    <tr><td>操作者</td><td>操作时间</td><td>操作ip</td><td>备注</td></tr>
                    <tr><td colspan="7" class="text-center">当前无操作信息</td></tr>
                    </tbody>
                </table>
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有订单详情 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection
@push('script')
<script>

    $().ready(function () {


    })

</script>
@endpush